import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Scanner;
import java.util.Stack;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 22652
 * Date: 2024-09-02
 * Time: 11:58
 */
public class test_7 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNext()) { // 注意 while 处理多个 case
            Stack<Character> stack=new Stack<>();
            String next = in.next();
            char[] charArray = next.toCharArray();
            for (char ch : charArray){
                if (stack.empty()){
                    stack.push(ch);
                }else {
                    Character peek = stack.peek();
                    if (peek==ch){
                        stack.pop();
                    }else {
                        stack.push(ch);
                    }
                }
            }
            
        }
    }
}
